package com.laan.bmagame;

import android.graphics.Bitmap;
import android.graphics.Canvas;

public class Objecte {
	public float x;
	public float y;
	public float width;
	public float height;
	public float vx;
	public float vy;
	public float g;
	private Bitmap img;
	
	public Objecte(Bitmap bm, float nx, float ny, float ntx, float nty, float nvx, float nvy) {
		x = nx;
		y = ny;
		width = ntx;
		height = nty;
		vx = nvx;
		vy = nvy;
		g = 0f;
		img = Bitmap.createScaledBitmap(bm,(int)width,(int)height,false);
	}
	
	public void enableGravity() {
		g = 0.5f;
	}
	
	public void actualitza() {
		vy += g;
		x += vx;
		y += vy;
	}
	
	public void draw(Canvas canvas) {
		canvas.drawBitmap(img, x, y, null);
	}
}
